classdef grav_params < handle
  properties (GetAccess='public', SetAccess='private')


    % background T offset
    T   = 1

    % number of samples in each dimension
    Nx        = 32
    Ny        = 32
    Nz        = 32

    % physical size in each dimension
    Lx        = 100
    Ly        = 100
    Lz        = 1
    Lz0       = 0

    % cell coordinate values
    Cx
    Cy
    Cz

    % coordinate distance between adj cells
    Dx
    Dy

    hydroOrder = 2;

    RelTol = 1e-7;
    AbsTol = 1e-9;

  end

  properties
    % evaluation point time
    t
    % evaluation point diff t
    dt

    % control flags
    metricOrder = 2;

    metricLinearFnInterpolation = false;
    
    plotMetric = false;
  end
  methods 
    function this=grav_params(p, Nz)
      this.T   = p.T;
      this.Nx     = p.Nx;
      this.Ny     = p.Ny;
      this.Lx     = p.Lx;
      this.Ly     = p.Ly;
      this.Cx     = p.Cx;
      this.Cy     = p.Cy;
      this.Dx     = p.Dx;
      this.Dy     = p.Dy;
      this.hydroOrder = p.hydroOrder;
      this.RelTol = p.RelTol;
      this.AbsTol = p.AbsTol;

      % number of samples
      this.Nz = Nz;


      this.Lz = 1/this.T; % apparent horizon

      % min Lz:
      ref0 = 0.1;  % reference boundary at T = 1
      % changes in T will move the position of the horizon.
      % this affects integration of tensors.
      % set a reference: when T = 1, integrate from rh = 1 to ref0 \approx 0
      % at a differentt temperature T, choose the bounday integration limit 
      % so as to get the same volume integral. 
      % this is the answer:
      this.Lz0 = ref0.*(1+(-1).*ref0.^3+this.T.^3.*ref0.^3).^(-1/3);
      % or simply set to zero
      this.Lz0 = 0;

      % cell values
      %   this.Lz0 -- position of the boundary
      %   this.Lz  -- position of the (stationary) apparent horizon
      this.Cz = cheb_grid(this.Nz, this.Lz0, this.Lz);
    end

  end
end
